Fix false ET budget exhaustion classification in workflow failure handling#31127
Merged
Fix false ET budget exhaustion classification in workflow failure handling#31127
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix Matt Pocock Skills Reviewer workflow failure due to token budget issue
Fix false ET budget exhaustion classification in workflow failure handling
May 9, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes a false-positive “Effective Token Budget Exhausted” classification by reconciling rate-limit signals with actual effective-token usage vs configured maximum before surfacing the failure state.
Changes:
- Added budget-math reconciliation for effective-tokens rate-limit reporting (requires
effectiveTokens >= maxEffectiveTokenswhen both are known). - Normalized/validated env fallback values so invalid token counts are treated as missing.
- Added targeted unit tests covering below-budget suppression, at-budget confirmation, missing/invalid max, and no-signal behavior.
Show a summary per file
| File | Description |
|---|---|
| actions/setup/js/effective_tokens_context.cjs | Adds BigInt-based comparison and gating logic for ET budget exhaustion; validates env fallbacks before ET math. |
| actions/setup/js/handle_agent_failure.test.cjs | Adds regression tests for resolveEffectiveTokensFailureState() scenarios around ET budget exhaustion classification. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 2/2 changed files
- Comments generated: 1
Comment on lines
+1950
to
+1954
| it("keeps ET budget exhaustion when the rate-limit signal is present but no max is available", () => { | ||
| process.env.GH_AW_EFFECTIVE_TOKENS = "2097968"; | ||
| process.env.GH_AW_EFFECTIVE_TOKENS_RATE_LIMIT_ERROR = "true"; | ||
|
|
||
| expect(resolveEffectiveTokensFailureState()).toEqual({ |
Collaborator
|
@copolilot merge main and recompile |
Collaborator
|
@copilot Merge main and recompile |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Contributor
Author
Collaborator
|
@copilot Merge main and recompile |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Contributor
Author
Copilot AI
added a commit
that referenced
this pull request
May 9, 2026
…dling (#31127) Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
mainand determine whether another merge/recompile is neededmainand recompile if the branch is behind